#ifndef POPUP_H
#define POPUP_H

#include <QtGui/QWidget>
#include <QtGui/QSystemTrayIcon>
#include <QtGui/QMenu>

QT_BEGIN_NAMESPACE
class QMenu;
class QCloseEvent;
QT_END_NAMESPACE

namespace Ui {
    class Popup;
}

class Popup : public QWidget {
    Q_OBJECT

public:
     Popup(QWidget *parent = 0);
    ~Popup();
     void changePopupPosition(int atTheTop);
     void setWebViewLocation(QString location);
     //bool winEvent(MSG * m);
     void keypress(QString mykey);

 private slots:
     void clickactions(QSystemTrayIcon::ActivationReason reason);

 public slots:
     void XSS(QString message);
     void showMessage(QString message);
     int sumIt(int a, int b);
     void changePopupStatus(int visible = NULL);
     void changePopupSize(int width, int height, int atTheTop);
     void registerHotKey(QString keyCombo);
     void togglePopupStatus();

protected:
    void changeEvent(QEvent *e);
    void closeEvent(QCloseEvent *event);

private:
    Ui::Popup *ui;
    void createTrayIcon();
    void createActions();
    QSystemTrayIcon *trayIcon;
    QMenu *trayIconMenu;
    QAction *minimizeAction;
    QAction *restoreAction;
    QAction *quitAction;
    QString javascriptXSS;

private slots:
    void connectObject();
};

#endif // POPUP_H
